home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb11.zip / INKEY.PAS < prev    next >
Pascal/Delphi Source File  |  1985-07-13  |  904b  |  37 lines

  1. PROGRAM KeyDemo;
  2. {$C-}
  3. {
  4. Demonstration program for InKey function
  5.  
  6. Source: "INKEY: A Multiple Keypress Function", TUG Lines Volume I Issue 4
  7. Author: Orville Jenkins/Panther Associates/Dallas-Ft.Worth,Texas/
  8. Application: MS-DOS, PC-DOS
  9. }
  10.  
  11. var
  12.  specialkey : boolean;
  13.  command    : char;
  14.  
  15. {$I INKEY.INC}
  16.  
  17. begin
  18.  clrscr;
  19.  writeln('INKEY DEMO - Press any key - Press F10 to quit');
  20.  writeln;
  21.  command := #00;
  22.  
  23.  repeat
  24.   if inkey(specialkey,command)
  25.    then
  26.    begin { Tell caller the value of the key }
  27.     if specialkey
  28.      then writeln('That''s a SPECIAL key - the ascii code is ',ord(command))
  29.      else writeln('That''s a REGULAR key - the ascii code is ',ord(command));
  30.     writeln;
  31.     if command <> #68
  32.      then writeln('INKEY DEMO - Press any key - Press F10 to quit');
  33.      writeln;
  34.    end;
  35.  until command = #68; { That is, the F10 key }
  36. end. {Program KeyDemo}
  37.